package fmse.uaic.k.tests;

import static org.junit.Assert.assertTrue;

import org.junit.Test;

import fmse.uaic.k.configuration_abstraction.data_structures.ConfigurationKTree;
import fmse.uaic.k.configuration_abstraction.data_structures.RuleKTree;
import fmse.uaic.k.xml.adapter.XmlToKAbstractTree;

public class ReadConfigurationTest {

	@Test
	public final void testLoadConfiguration() {
		XmlToKAbstractTree convertor = new XmlToKAbstractTree();

		ConfigurationKTree tree = convertor
				.loadConfiguration("/Users/andreiarusoaie/Documents/workspace/contextual-transformers/configuration-abstraction/src/fmse/uaic/k/resources/configuration.xml");
		//tree.print();
		assertTrue(tree != null);

	}

	@Test
	public final void testLoadRule() {
		XmlToKAbstractTree convertor = new XmlToKAbstractTree();

		RuleKTree tree = convertor
				.loadRule("/Users/andreiarusoaie/Documents/workspace/contextual-transformers/configuration-abstraction/src/fmse/uaic/k/resources/rule1.xml");
		//tree.print();
		assertTrue(tree != null);

		tree = convertor
				.loadRule("/Users/andreiarusoaie/Documents/workspace/contextual-transformers/configuration-abstraction/src/fmse/uaic/k/resources/rule2.xml");
		//tree.print();
		assertTrue(tree != null);

		tree = convertor
				.loadRule("/Users/andreiarusoaie/Documents/workspace/contextual-transformers/configuration-abstraction/src/fmse/uaic/k/resources/rule3.xml");
		//tree.print();
		assertTrue(tree != null);

		tree = convertor
				.loadRule("/Users/andreiarusoaie/Documents/workspace/contextual-transformers/configuration-abstraction/src/fmse/uaic/k/resources/rule4.xml");
		//tree.print();
		assertTrue(tree != null);

		tree = convertor
				.loadRule("/Users/andreiarusoaie/Documents/workspace/contextual-transformers/configuration-abstraction/src/fmse/uaic/k/resources/rule5.xml");
		//tree.print();
		assertTrue(tree != null);

		tree = convertor
				.loadRule("/Users/andreiarusoaie/Documents/workspace/contextual-transformers/configuration-abstraction/src/fmse/uaic/k/resources/rule6.xml");
		//tree.print();
		assertTrue(tree != null);

		tree = convertor
				.loadRule("/Users/andreiarusoaie/Documents/workspace/contextual-transformers/configuration-abstraction/src/fmse/uaic/k/resources/rule7.xml");
		//tree.print();
		assertTrue(tree != null);
	}
}
